package cn.iocoder.yudao.module.yyzx.dal.mysql.outings;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.outings.OutingsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.outings.vo.*;

/**
 * 外出管理 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface OutingsMapper extends BaseMapperX<OutingsDO> {

    default PageResult<OutingsDO> selectPage(OutingsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OutingsDO>()
                .eqIfPresent(OutingsDO::getEldenId, reqVO.getEldenId())
                .betweenIfPresent(OutingsDO::getOutingTime, reqVO.getOutingTime())
                .betweenIfPresent(OutingsDO::getReturnTime, reqVO.getReturnTime())
                .eqIfPresent(OutingsDO::getLocation, reqVO.getLocation())
                .eqIfPresent(OutingsDO::getReason, reqVO.getReason())
                .betweenIfPresent(OutingsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OutingsDO::getId));
    }

}